package com.xm.settlement.service.impl;

import com.baomidou.framework.service.impl.SuperServiceImpl;
import com.baomidou.mybatisplus.plugins.Page;
import com.xm.settlement.commons.utils.PageInfo;
import com.xm.settlement.mapper.WechatServiceMapper;
import com.xm.settlement.model.WechatService;
import com.xm.settlement.service.WechatSerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 客服管理
 */
@Service
public class WechatSerServiceImpl extends SuperServiceImpl<WechatServiceMapper,WechatService> implements WechatSerService{

    @Autowired
    private  WechatServiceMapper wechatServiceMapper;


    @Override
    public void selectWeChatServiceList(PageInfo pageInfo){
        Page<WechatService> page = new Page<WechatService>(pageInfo.getNowpage(), pageInfo.getSize());
        List<WechatService> list = wechatServiceMapper.selectWeChatServiceList(page);
        pageInfo.setRows(list);
        pageInfo.setTotal(page.getTotal());
    }

    @Override
    public WechatService selectWechatServiceByIndex(int index){
        return wechatServiceMapper.selectWechatServiceByIndex(index);
    }
}
